home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-03 | 4.2 KB | 158 lines | [TEXT/CWIE] |
- //----------------------------------------------------------------------------------------
- // UODPartView.h
- // Copyright © 1994-96 by Apple Computer, Inc. All rights reserved.
- //----------------------------------------------------------------------------------------
-
- #if qContainer
-
- #ifndef __UODPARTVIEW__
- #define __UODPARTVIEW__
-
- // CALib
-
- #ifndef _CALIB_
- #include "CALib.h"
- #endif
-
- // MacApp
-
- #ifndef __UGEOMETRY__
- #include "UGeometry.h"
- #endif
-
- #ifndef __ULISTITERATOR__
- #include "UListIterator.h"
- #endif
-
-
- //----------------------------------------------------------------------------------------
- // TODPartView
- //----------------------------------------------------------------------------------------
-
- class TODPartView : public TView
- {
- MA_DECLARE_CLASS;
-
- public:
- TFileBasedDocument* fContainerDocument;
- TODPartView();
- virtual ~TODPartView();
- virtual void IODPartView(TDocument* itsDocument,
- TView* itsSuperView,
- const VPoint& itsLocation,
- const VPoint& itsSize,
- SizeDeterminer itsHSizeDet,
- SizeDeterminer itsVSizeDet,
- CAFrameRef frameRef);
- virtual void DoPostCreate(TDocument* itsDocument);
- virtual void Draw(const VRect& area);
- virtual void ReadFrom(TStream* aStream);
- virtual void SetFrame(const VRect& newFrame, Boolean invalidate);
- virtual void WriteTo(TStream* aStream);
- virtual CAFrameRef GetFrameRef() const;
- virtual void SetFrameRef(CAFrameRef newFrameRef);
-
- virtual void AquirePartFromFile(FSSpec thePartFile);
- //clone a frameRef from a source document.
-
- virtual void AquirePartFromDocument(CADocumentRef sourceDoc);
- //clone a frameRef from a source document.
-
- virtual Boolean NegotiateFrameChange(RgnHandle theRgn);
- //ask the view if it is interested in the frame
- //change request of the part.
-
- virtual void RemovePart();
- //remove the embedded part
-
- virtual void SizePartToView();
- //force the part conform to the size of the view
-
- virtual void SizeViewToPart();
- //force the view conform to the size of the part
-
- virtual Boolean HasPart();
- //Does this view have an embedded part?
-
- virtual void DoKeyEvent(TToolboxEvent* event);
- //Handle the delete key.
-
- virtual void DoSetupMenus();
-
- virtual void DoMenuCommand(CommandNumber aCommandNumber);
-
- virtual Boolean WillAcceptDrop(CDragItemIterator& dragItemIterator);
- virtual TCommand* DoMakeDragDropCommand(CommandNumber itsCommandNumber,
- CDragItemIterator& dragItemIterator);
-
- Boolean fSizePartToView;
- //keeps the size of the view and the part in synch
- Boolean fRejectFrameChangeRequests;
- //allows the application total control over frame size if false
-
- protected:
- VPoint fCachedOrigin;
- CAFrameRef fFrameRef;
- Boolean fHasPart;
-
- };
-
- //----------------------------------------------------------------------------------------
- // TODPartViewCommand:
- //----------------------------------------------------------------------------------------
-
- class TODPartViewCommand : public TCommand
- {
- MA_DECLARE_CLASS;
-
- protected:
- FSSpec fFileSpec;
- TODPartView* fODPartView;
-
- public:
- TODPartViewCommand();
- // Constructor
-
- void IODPartViewCommand(FSSpec theFileSpec,
- TODPartView* thePartView,
- CommandNumber itsCommandNumber,
- TCommandHandler* itsContext,
- Boolean canUndo,
- Boolean causesChange,
- TObject* objectToNotify);
-
- virtual ~TODPartViewCommand();
-
- virtual void DoIt();
-
- //virtual void UndoIt();
- };
-
-
- //----------------------------------------------------------------------------------------
- // CODPartViewIterator:
- //----------------------------------------------------------------------------------------
- class CODPartViewIterator : public CObjectIterator
- {
- public:
-
- CODPartViewIterator(TFileBasedDocument* theFBDocument, Boolean itsForward);
-
- CODPartViewIterator(TFileBasedDocument* theFBDocument);
-
- virtual ~CODPartViewIterator();
-
- TODPartView* CurrentODPartView();
-
- TODPartView* FirstODPartView();
-
- TODPartView* NextODPartView();
- };
-
-
- extern void InitUODPartView();
-
-
- #endif
- #endif //qContainer
-